<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%

%>
<!DOCTYPE html>
<html>

<head>
<%-- <base href="<%=basePath%>"> --%>
<title></title>
<meta name="token" content="Hege Refsnes">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

<link rel="stylesheet" type="text/css"
	href="<%=basePath%>resourse/jquery-easyui-1.4.5/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"
	href="<%=basePath%>resourse/jquery-easyui-1.4.5/themes/icon.css">
<link rel="stylesheet" type="text/css"
	href="<%=basePath%>resourse/jquery-easyui-1.4.5/themes/color.css">
<script type="text/javascript"
	src="<%=basePath%>resourse/jquery-easyui-1.4.5/jquery.min.js"></script>
<script type="text/javascript"
	src="<%=basePath%>resourse/jquery-easyui-1.4.5/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="<%=basePath%>resourse/jquery-easyui-1.4.5/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript"
	src="<%=basePath%>resourse/jquery-easyui-1.4.5/datagrid-filter.js"></script>
<script type="text/javascript" src="<%=basePath%>resourse/js/common.js"></script>
<!-- <link rel="stylesheet" type="text/css" href="resourse/css/login.css"> -->
<style>
body {
	font-family: "Helvetica Neue", Helvetica, "PingFang SC",
		"Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
	/* 	margin: 0; */
}

#filebg {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	opacity: 0.3;
	filter: alpha(opacity = 30);
	display: none;
	z-index: 10001;
	background: #ccc;
}

#fileshow {
	position: absolute;
	top: 50%;
	margin-top: -20px;
	padding: 10px 5px 10px 30px;
	width: auto;
	height: 16px;
	border-width: 2px;
	border-style: solid;
	display: none;
	border-color: #95B8E7;
	z-index: 10002;
	margin-left: calc(100%/ 2 - 100px/ 2);
}

.file-mask {
	position: fixed;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
	background-color: black;
	opacity: .1;
	filter: alpha(opacity = 10);
	z-index: 100;
}
</style>
</head>
<script>
			var PUser = JSON.parse(localStorage.getItem('sysUser'));
			var globalePermisson ;
			if(localStorage.getItem('PERMISSIONS')){
				globalePermisson = new Map(Object.entries(JSON.parse(localStorage.getItem('PERMISSIONS'))));
			}
			console.log('PUser:', PUser);
			console.log('globalePermisson:', globalePermisson);
			if (!PUser) {
				window.parent.parent.location.href = '<%=basePath%>sys/login';
			}
			//var strPer = '${display_permissions}';
			// 	var Permission = '(,' + strPer + ',)';
			//全局添加token
			$(document).ajaxSend(function (event, jqxhr, settings) {
				jqxhr.setRequestHeader('token', localStorage.getItem('token'));
				settings.url = '<%=basePath%>api/' + settings.url;
				console.log('setting:', settings.url);
				jqxhr.setRequestHeader('currenturl', window.location.pathname);
			});
			$(document).ajaxStart(function () {
				load();
			});
			$(document).ajaxStop(function () {
				disLoad();
			});
			$.ajaxSetup({
				beforeSend: function (xhr) {
				},
				complete: function (xhr) {
					console.log(xhr);
					//token过期，则跳转到登录页面 
					if (xhr.responseJSON && xhr.responseJSON.code && xhr.responseJSON.code == 60901) {
						window.parent.parent.location.href = '<%=basePath%>sys/login';
					} else if (xhr.responseJSON && xhr.responseJSON.code && xhr.responseJSON.code == 60601) {
						// 				alert(xhr.responseJSON.msg);
					}
				}
			});

			function showFilediv() {
				document.getElementById("filebg").style.display = "block";
				document.getElementById("fileshow").style.display = "block";
			}

			function hideFilediv() {
				document.getElementById("filebg").style.display = 'none';
				document.getElementById("fileshow").style.display = 'none';
			}

			//弹出加载层
			function load() {
				$("<div class=\"datagrid-mask\"></div>").css({
					"display": "block",
					"position": "absolute",
					"left": "0",
					"top": "0",
					opacity: "0.3",
					"z-index": "10001",
					"background-color": "white",
					"width": "100%",
					"height": $(window).height()
				}).appendTo("body");
				$("<div class=\"datagrid-mask-msg\"></div>").html("加载中，请稍候...").appendTo("body").css({
					display: "block",
					"z-index": "10002",
					left: ($(document.body).outerWidth(true) - 190) / 2,
					top: ($(window).height() - 45) / 2
				});
				// 		 $(".datagrid-mask").show();
				// 	 	 $(".datagrid-mask-msg").show();
			} //取消加载层  
			function disLoad() {
				// 	    $(".datagrid-mask").hide();
				// 	    $(".datagrid-mask-msg").hide(); 
				$(".datagrid-mask").remove();
				$(".datagrid-mask-msg").remove();
			} 
		</script>
<style>
/* .datagrid-mask-msg{ */
/* 	margin-left: calc(100% / 2 - 100px / 2);/*实现水平居中*/
/* 	width:150px; */
/* } */
</style>

<body>
	<!-- <div class="datagrid-mask" style="opacity: 0.3; display:block;left:0;top 0;position:absolute;width:100%;height:100%;z-index:10001;background-color:white;"> -->
	<!-- </div> -->
	<!-- <div class="datagrid-mask-msg" style="display:block;z-index:10002;">加载中，请稍候...</div> -->
	<div id="filebg"></div>
	<div id="fileshow">加载中，请稍候...</div>
</body>

</html>